<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
     <meta http-equiv="content-Type" content="text/html; charset=utf-8" />
    <title>送花</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	 <script type="text/javascript" src="<%=path %>/script/jquery.js"></script>
	 <style type="text/css">
	 body{
	   text-align:center;
	   
	 }
	 #flowercontainer{
	   width:50%;
	   text-align:left;
	 }
	  #flowercontainer ul li img{
	   margin:2px 4px 2px 4px;
	  }
	 </style>
	<script type="text/javascript">
	$(function(){
	
	  // ${param.topicid};
	   $("#tijiao").bind("click", function(){
	      var valradio = $("input[@type=radio][@checked]").val(); 
	      var sendData = {"flowid":valradio,"topicid":"${param.topicid}"};
	    //  alert("${param.topicid}");
	     	$.ajax({
            type:"POST",
            url: "<%=request.getContextPath()%>/sendFlower.do", 
            dataType:'html', //接受数据格式
            async: false,
            data: sendData, 
            success: function(data){   
                  if(data=='true'){ 
                    alert("献花成功！");
                    　　　 window.location.reload();
                  }else{
                    //显示在验证码后面
                   alert("送花失败");
                  }  
                },
           error:function(data){
             alert(data);
           }}
             ) 
      });
	   });
       
			 
	 
	</script>
	 

  </head>
  
  <body>
  <div id="flowercontainer">
   <form action="">
    <ul>
    <li><input type="radio" name="flower" value="1"  checked /><img src="<%=path %>/themes/images/flower_2_b.gif"/>鲜花支持!</li>
    <li><input type="radio" name="flower" value="2"/><img src="<%=path %>/themes/images/flower_3_b.gif"/>这个作品很赞! </li>
    <li><input type="radio" name="flower" value="3"/><img src="<%=path %>/themes/images/flower_1_b.gif"/>作者太有才了!</li>
    <li><input type="radio" name="flower" value="4"/><img src="<%=path %>/themes/images/flower_4_b.gif"/>看的都流口水了!</li>
    <li><input type="radio" name="flower" value="5"/><img src="<%=path %>/themes/images/flower_5_b.gif"/>拍的真好!</li>
    <li><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" id="tijiao" value="提交" /></li>
    </ul>
    
    </form>
    </div>
  </body>
</html>
